<?php

namespace App\Console\Commands;

use App\Lib\ConsumerExchange;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

class Exchange extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'balance:exchange';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '兑换返利';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        try {
            
            $consumer = new ConsumerExchange();
            $res = $consumer->consumer();
            $this->info($res['msg']);
        } catch (\Exception $e) {
            Log::error($e->getMessage());
        }
    }
}
